import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

const store = new Vuex.Store({
    /** 初始化存值 */
    state:{
        loginPeriodName:"",
        jijList:{},
        jijNo:[],
        choseJiJPageIndex:1,
    },
    mutations:{
        updatePeriodName(state,value){
            var url;
            if (value == 1 || value == 2 || value == 4) {
                url = 'https://m' + value + '.maoqio.com/Api'
            } else {
                if (value == 3) {
                    url = 'https://ml' + value + '.maoqio.com/Api'
                } else if (value == 5) {
                    url = 'https://gudi.maoqio.com/Api'
                } else if (value == 6) {
                    url = 'https://xxh.maoqio.com/Api'
                }else{
                   url =  'https://m1.maoqio.com/Api'
                }
            }
            state.loginPeriodName = url;
        },
        changeList(state,value){
            state.jijList = value;
        },
        updateCheckNo(state,value){
            state.jijNo = value;
        },
        udpataJiJPageIndex(state,value){
            state.choseJiJPageIndex = value;
        }
    },
    getters:{}
});

export default store;